<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>伪元素选择器before、after</title>
    <style>
        div {
            width: 300px;
            height: 200px;
            background-color: pink;
        }

        /* 伪元素的选择的权重跟标签选择器一样都是1  */
        /* 这个content属性必须要有 不然before无效 */
        /* 属于行内元素给宽高需要转换块级元素或者加了定位也可以直接给 */
        div::before {
            display: inline-block;
            content: "我";
           width: 20px;
           height: 20px;
           background-color: skyblue;
            
        }

        div::after {
            content: "刘德华";
        }
    </style>
</head>

<body>
    <div>
        是
    </div>
</body>

</html>